package com.zcf.controller;

import com.nanyang.config.ResponseResult;
import com.nanyang.entity.Goods;
import com.nanyang.entity.Promotion;
import com.nanyang.service.GoodsService;
import com.nanyang.service.PromotionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("goods")
public class GoodsController {
    @Autowired
    private GoodsService goodsService;
    @Autowired
    private PromotionService promotionService;


    @RequestMapping("list")
    public ResponseResult list(){

        List<Goods> list = goodsService.list();

        list.forEach(goods -> {
            Integer id = goods.getId();
//            Promotion p = promotionService.finfById(id);

        });
        return ResponseResult.success(list);
    }
}
